import Cookies from "js-cookie";

export const TokenKey = "Order-Meal-Token";
export const UserInfoKey = "Order-Meal-User-Info";

export function getToken() {
  return Cookies.get(TokenKey);
}

export function setToken(token: string) {
  return Cookies.set(TokenKey, token);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function getCookie(key: string): string {
  return Cookies.get(key) + "";
}
export function setCookie(key: string, value: string) {
  return Cookies.set(key, value);
}
export function removeCookie(key: string) {
  return Cookies.remove(key);
}

export function getLocalStorage(key: string): string {
  return localStorage.getItem(key) + "";
}
export function setLocalStorage(key: string, value: string) {
  return localStorage.setItem(key, value);
}
export function removeLocalStorage(key: string) {
  return localStorage.removeItem(key);
}
